package com.itbaizhan;

import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;

public class JDBCTest {
    public static void main(String[] args) throws ClassNotFoundException, SQLException, IOException {
        Properties pro = new Properties();
        InputStream is = JDBCTest.class.getClassLoader().getResourceAsStream("db.properties");
        pro.load(is);


        String url = pro.getProperty("url");
        String username = pro.getProperty("username");
        String pwd = pro.getProperty("pwd");

        Class.forName(pro.getProperty("driver"));
        Connection connection = DriverManager.getConnection(url, username, pwd);
        System.out.println(connection);
    }
}
